package com.appstore.mapper;

import com.appstore.domain.entity.App;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AppMapper {
    List<App> getAppList();

    List<App> getAppByConditions(App app);

    App getAppById(Long id);

    int updateRating(@Param("id") Long id,@Param("rating") Double rating);

    Integer addApp(App app);

    App getAppByBundleName(String bundleName);

    List<App> getEssentialForNewDevices();

    /**
     * 查询应用详情列表
     *
     * @param app 应用详情
     * @return 应用详情集合
     */
    public List<App> selectAppList(App app);
    /**
     * 新增应用详情
     *
     * @param app 应用详情
     * @return 结果
     */
    public int insertApp(App app);

    /**
     * 修改应用详情
     *
     * @param app 应用详情
     * @return 结果
     */
    public int updateApp(App app);

    /**
     * 删除应用详情
     *
     * @param id 应用详情主键
     * @return 结果
     */
    public int deleteAppById(Long id);

    /**
     * 批量删除应用详情
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteAppByIds(Long[] ids);
}
